import React, { Component } from 'react';
import './comment.scss'
import Header from './header/header'
import List from './list/list'

class Comment extends Component {

    state = {
        arr: [
            
        ]
    }
    release = (commentator, commentData) => {
        // console.log(111, commentator, commentData);
        const arr = [...this.state.arr]
        // console.log(22, newArr);
        arr.push({ commentator, commentData })
        // console.log(newArr);
        this.setState({
            arr
        })
        console.log(this.state.arr);
    }
    render() {
        return (<>
            <div className='comment'>
                {/* {评论头部} */}
                <Header release={this.release} />
                {/* {评论列表} */}
                <List arr={this.state.arr} />
            </div>
        </>);
    }
}

export default Comment;